import request from '@/utils/request'

// 获取角色列表
// export const reqGetRoleList = (obj = { page: 1, pageSize: 2 }) => {
//   return request({
//     method: 'get',
//     url: '/sys/role',
//     params: obj
//   })
// }
export const reqGetRoleList = (page = 1, pagesize = 2) => {
  return request({
    method: 'get',
    url: '/sys/role',
    params: {
      page, pagesize
    }
  })
}
// 删除角色
export const reqDeleteRole = (id) => {
  return request({
    method: 'delete',
    url: `/sys/role/${id}`
  })
}

// 增加角色
export const reqAddRole = (data) => {
  return request({
    method: 'post',
    url: '/sys/role',
    data
  })
}

// 修改角色
export function reqUpdateRole(data) {
  return request({
    method: 'put',
    url: `/sys/role/${data.id}`,
    data
  })
}

// 根据 id 获取角色详情, 用于回显
export function reqGetRoleDetail(id) {
  return request({
    method: 'get',
    url: `/sys/role/${id}`
  })
}
